.TH std::ranges::split_view::end 3 "2024.06.10" "http://cppreference.com" "C++ Standard Libary"
.SH NAME
std::ranges::split_view::end \- std::ranges::split_view::end

.SH Synopsis
   constexpr auto end() const;  \fI(since C++20)\fP

   Returns an iterator or a sentinel representing the end of the resulting subrange.

   Equivalent to:

 constexpr auto end()
 {
     if constexpr (ranges::common_range<V>)
         return /*iterator*/{*this, ranges::end(base_), {}};
     else
         return /*sentinel*/{*this};
 }

.SH Parameters

   \fI(none)\fP

.SH Return value

   An iterator or a sentinel.

.SH Example


// Run this code

 #include <iostream>
 #include <ranges>
 #include <string_view>

 int main()
 {
     constexpr std::string_view keywords{"bitand bitor bool break"};
     std::ranges::split_view kw{keywords, ' '};
     const auto count = std::ranges::distance(kw.begin(), kw.end());
     std::cout << "Words count: " << count << '\\n';
 }

.SH Output:

 Words count: 4

.SH See also

   begin       returns an iterator to the beginning
   (C++20)     \fI(public member function)\fP
   end         returns an iterator or a sentinel to the end
   (C++20)     \fI(public member function of std::ranges::lazy_split_view<V,Pattern>)\fP

   ranges::end returns a sentinel indicating the end of a range
   (C++20)     (customization point object)
